#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    string makeGood(string s) {
        auto it = s.begin();
        while (it != s.end())
        {
            if (*it == *(it + 1) - 32 || *it == *(it + 1) + 32)
            {
                s.erase(it, it + 2);
                it = s.begin();
                continue;
            }
            ++it;
        }

        return s;
    }
};